﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using s2b.ControleDesenvolvimentoProjetos.Util.Auxiliar;
using s2b.ControleDesenvolvimentoProjetos.Dados.OBJ;

namespace s2b.ControleDesenvolvimentoProjetos.Paginas
{
    public partial class WFBacklog : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           // MontaBacklog();
        }

        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                   case "Atribuir":
                    Response.Redirect(String.Format("WFAtribuirTarefa.aspx?ID_TAREFA={0}", Auxiliar.RetornaIdRegistro(e, GridView1, "ID_TAREFA")));


                    break;
            }       
        }

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            

          

        }

        //public void MontaBacklog() {

        //    Table tblPrincipal = new Table();

        //    SqlDataReader executa = Auxiliar.RetornaRegistros("SELECT * FROM PROJETO", Projeto.Tabela);
        //    if (executa != null)
        //    {
        //        int cont = 1;
        //        while (executa.Read())
        //        {
                    
        //            GridView grid = new GridView();
        //            grid.ID = "grid" + cont;
        //            Auxiliar.RetornaTabela(grid, Tarefa.Tabela, String.Format("SELECT * FROM TAREFAS WHERE ID_PROJETO = {0}", executa[Projeto.Id].ToString()));
        //            Table tbl = new Table();
        //            TableRow row = new TableRow();
        //            TableCell cell = new TableCell();
        //            cell.Controls.Add(grid);
        //            row.Controls.Add(cell);
        //            tbl.Controls.Add(row);

        //            TableRow rowPrincipal = new TableRow();
        //            TableCell cellPrincipal = new TableCell();
        //            cellPrincipal.Controls.Add(tbl);
        //            rowPrincipal.Controls.Add(cellPrincipal);
        //            tblPrincipal.Controls.Add(rowPrincipal);

                   
        //            cont++;
        //        }
        //        pnlBacklog.Controls.Add(tblPrincipal);
        //    }
        
        
        //}
    }
}